
<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <th width="135px">Số hóa đơn</th>
        <th width="340px">Ngày</th>
        <th width="150px">Giá</th>
        <th width="150px">Trạng thái</th>              
        <th width="100px">Xem đơn hàng</th>
    </tr>
    <?php
		foreach($result as $r){
			if($r->status==0){
				$status= 'Đang chờ duyệt';
			}else{
				$status= 'Đã duyệt';
			}
			$priceTmp=$this->cart->getCartDetail($r->id);
			$price='';
			foreach($priceTmp as $row){
				$price +=$row->qty*$row->price;
			}
	?>
    <tr>
        <td align="center"><?=$r->maHD?></td>
        <td><?=date('d-m-Y H:i:s',strtotime($r->created))?></td>
        <td align="center"><?=number_format($price,0,',','.');?> vnđ</td>
        <td align="center"><?=$status?></td>
        <td align="center"><a href="<?=PATH_URL.'chi-tiet-don-hang/'.$r->id?>">Xem</a></td>
    </tr>
    <?php }?>
</table>

<div class="pagination" style="text-align: right;"><?=$this->adminpagination->create_links();?></div>
